package com.heima;

/***
 *@title RegexDemo13
 *@description <TODO description class purpose>
 *@author 12468
 *@version 1.0.0
 *@create 2025-09-05 0:04
 **/
public class RegexDemo13 {
    public static void main(String[] args) {
        /**
         * 将字符串：我要学学编编编编程程程程程程。
         * 替换为：我要学编程
         */
        String str = "我要学学编编编编程程程程程程";
        String regex = "(.)\\1+";
        String $1 = str.replaceAll(regex, "$1");
        System.out.println($1);
    }
}
